package com.example.design.factory.factorymethod;

/**
 * 客户端
 */
public class Client {
    public static void main(String[] args) {
        AnimalFactory animalFactory = new CatFactory();
        Animal cat = animalFactory.createAnimal();
        cat.sound();

        AnimalFactory factory = new DogFactory();
        Animal dog = factory.createAnimal();
        dog.sound();
    }
}
